package com.example.renttest.main;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;
import android.widget.RadioGroup;


import com.example.renttest.R;
import com.example.renttest.main.fragment.*;
import com.example.renttest.main.utils.FragmentTabUtils;

import java.util.ArrayList;

public class MainActivity extends AppCompatActivity {
    private RadioGroup radioGroup;
    private ArrayList<Fragment> fragments=new ArrayList<>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        addFragment();
    }


    private void addFragment(){
        radioGroup= (RadioGroup) findViewById(R.id.radiogroup);
        radioGroup.check(R.id.bt1);
        fragments.add(new IndexFragment());
        fragments.add(new SereachFragment());
        fragments.add(new PersonFragment());
        FragmentTabUtils utils=new FragmentTabUtils(fragments,radioGroup,getSupportFragmentManager(),R.id.layout);
    }


}
